package com.xhwl.data.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.xhwl.common.dto.cent.sdata.AccountPersonalDTO;
import com.xhwl.common.dto.cent.sdata.AdminAccountDTO;
import com.xhwl.common.pojo.ResultJson;
import com.xhwl.common.pojo.cent.sdata.AdminAccount;
import com.xhwl.common.query.cent.AdminAccountQuery;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author: JCccc
 * @Description:
 * @Date: Create in 17:10 2020/12/2
 */
@RestController
public interface IAdminAccountService extends IService<AdminAccount> {

    /**
     * 根据用户名查找系统账号
     *
     * @param loginName
     * @return
     */
    AdminAccount findByLoginName(String loginName);

    /**
     * 创建系统账号
     *
     * @param adminAccount
     * @return
     */
    @RequestMapping(value = "/admin-account-service/create-admin-account", method = RequestMethod.POST)
    ResultJson<AdminAccount> createAdminAccount(@RequestPart("adminAccount") AdminAccount adminAccount);

    @RequestMapping(value = "/admin-account-service/update", method = RequestMethod.POST)
    ResultJson update(@RequestPart AdminAccountDTO adminAccount);

    @RequestMapping(value = "/admin-account-service/delete", method = RequestMethod.POST)
    ResultJson delete(@RequestPart Integer id);

    @RequestMapping(value = "/admin-account-service/page", method = RequestMethod.POST)
    Page page(@RequestPart AdminAccountQuery adminAccountQuery, @RequestPart Page page);

    ResultJson create(AdminAccountDTO adminAccountDTO);
    /**
     * 修改密码
     * @param id
     * @param pwd
     * @return
     */
    ResultJson modifyPwd(Integer id, String pwd);

    @RequestMapping(value = "/admin-account-service/view-list")
    List<AdminAccount> getList(@RequestPart("adminAccountQuery") AdminAccountQuery adminAccountQuery);

    ResultJson verifyPwd(Integer id, String pwd);

    ResultJson modifyPhone(AdminAccount adminAccount, AccountPersonalDTO accountPersonalDTO);
}
